home *** CD-ROM | disk | FTP | other *** search
- Rem Project: Planet Potter
- Rem Created: 25/07/2002 15:38:30
-
- rem Initialise
- sync on : sync rate 60
- set text font "Arial" : set text size 20
- set text to bold : set text transparent
-
- rem Load environment
- load object "media\moonlit\ml.x",100
- scale object 100,20,20,20
- set object cull 100,0
- set object light 100,0
- set object texture 100,2,1
-
- rem Load nine planets
- for p=1 to 9
- load object "media\planet\planet.x",p
- position object p,(p-3)*350,0,500
- hide object p
- next p
-
- rem Load player sounds
- load sound "media\sounds\shoot.wav",1
-
- rem Load game sounds
- load sound "media\sounds\appear.wav",11
- for s=12 to 19 : clone sound s,11 : next s
- load sound "media\sounds\explode.wav",21
- for s=22 to 29 : clone sound s,21 : next s
-
- rem Setup camera and light
- set camera range 0.1,3000
- set point light 0,-100,100,-200
-
- rem Starting rate
- prate=200
-
- rem Game loop
- do
-
- rem Control player cursor and shot
- if mouseclick()=1 and guncool=-1
- play sound 1 : guncool=3
- endif
- if guncool=0 and mouseclick()=0 then guncool=-1
- if guncool>0 then dec guncool
-
- rem Control planets
- gosub _newplanets
- gosub _moveplanets
-
- rem Rotate sky backdrop
- yrotate object 100,wrapvalue(object angle y(100)+0.1)
-
- rem Stats
- inc points
- prompt$="SCORE: "+str$(points)
- center text screen width()-text width(prompt$),screen height()-40,prompt$
-
- rem Update screen
- sync
-
- rem End loop
- loop
- end
-
- _newplanets:
-
- if pmaker>0 then dec pmaker
- if pmaker=0
- p=1 : while object visible(p)=1 and p<9 : inc p : endwhile
- x=rnd(3000)-1500
- y=rnd(2000)-1000
- position object p,x,y,1000
- play sound 10+p
- show object p
- pmaker=prate+rnd(prate/2)
- if prate>50 then dec prate,5
- endif
-
- return
-
- _moveplanets:
-
- rem Move all planets
- for p=1 to 9
- position object p,object position x(p)/1.007,object position y(p)/1.007,object position z(p)-5
- yrotate object p,wrapvalue(object angle y(p)+1)
- if object position z(p)<-600 then hide object p
- next p
-
- return
-
-